package org.yaukie.client;

/**
 * 通用动态代理客户端,调用soap服务
 * @author yaukie
 *
 */
public class DynamicClient {
	public static void main(String[] args) {
		//法一 使用通用动态代理
//		DynamicClientFactory dcf = DynamicClientFactory.newInstance();
//		Client client = dcf.createClient("http://localhost:8088/cxf/ws/soap/hello?wsdl");
//		Object[] results;
//		try {
//			results = client.invoke("doSth", "name");
//			System.out.println(results[0]);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
		
		//法二,使用client配置
//		ApplicationContext context = new ClassPathXmlApplicationContext("classpath:/resources/spring-cxf-client.xml");
//		HelloService helloService = context.getBean("helloService",HelloService.class);
//		String result = helloService.doSth("xiaobengbeng");
//		System.out.println(result);
	}
}
